package com.itheima.ssm.service.impl;

import com.github.pagehelper.PageHelper;
import com.itheima.ssm.dao.IOderDao;
import com.itheima.ssm.domain.Orders;
import com.itheima.ssm.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional
@Service
public class IOrderServiceImpl implements IOrderService {

    @Autowired
    private IOderDao oderDao;

    @Override
    public List<Orders> findAll(int page, int size) throws Exception {
        // pageNum 是页码值  参数pageSize 代表每页显示的条数
        PageHelper.startPage(page, size);
        return oderDao.findAll();
    }

    @Override
    public Orders selectById(String id) {
        return oderDao.selectById(id);
    }

    @Override
    public void deleteById(String id) {
        oderDao.deleteById(id);
    }

   /* @Override
    public void update(Orders orders) {
        oderDao.update(orders);
    }
*/
}